﻿#include "mainwindow.h"
#include "logindialog.h"

#include <QApplication>
#include "dbutil.h"

int main(int argc, char *argv[])
{
    qSetMessagePattern("%{time [yyyy-MM-dd hh:mm:ss.zzz]}%{appname}(%{pid}|%{threadid})>%{file}(%{line})#%{function}.%{type} << %{message}");

    DbUtil::initSqlLite();

    QApplication a(argc, argv);
    QApplication::setStyle(QStyleFactory::create("Fusion"));

    LoginDialog loginDialog;
    if(loginDialog.exec() == QDialog::Accepted)
    {
        MainWindow w;
        w.show();
        return a.exec();
    }

    return 0;
}
